﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UserMultiSearch.ascx.cs"
    Inherits="NetDon.OA.Portal.Components.UserMultiSearch" %>
<%@ Register TagPrefix="ucc" TagName="ReMark_1_1" Src="~/Controls/RequiredMark.ascx" %>
<script type="text/javascript" src="../Javascripts/json2.js"></script>
<script language="javascript" type="text/javascript">

    function ChooseUser() {
        $dialog('<%= ResolveUrl("~/Components/UserSearchPopup.aspx?Mode=Multi") %>', { width: 780, height: window.top.$common.getClientBounds().height - 100 }, function (result) {
            if (result) {

                var users = JSON.parse(result);

                if (!$array(users)) return;
                if ($array(users).length <= 0) return;
                var i = 0;
                var userId = "";
                var userName = "";
                Array.forEach($array(users), function (user) {
                    if (i++ != 0) {
                        userId += "|" + user.UserId;
                        userName += "|" + user.FullName;

                    }
                    else {
                        userId = user.UserId;
                        userName = user.FullName;

                    }

                })
                $text($get('<%=this.txtUserId.ClientID %>'), userId);
                $text($get('<%=this.txtUserName.ClientID %>'), userName);
            }
        });
        return false;
    }
</script>
<asp:TextBox runat="server" ID="txtUserName" MaxLength="50" Width="150px" BackColor="LightSkyBlue" ReadOnly="true" ></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtUserName"
    Display="None" ErrorMessage="请选择用户！" SetFocusOnError="True"></asp:RequiredFieldValidator>
<ucc:ReMark_1_1 ID="RequiredMark1" runat="server" />
<asp:HiddenField ID="txtUserId" runat="server" />
<asp:ImageButton ID="ImageButtonSearch" runat="server" SkinID="Selector" CausesValidation="false"
    OnClientClick="return ChooseUser();" />
